/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.kosongkosong.model.id;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.Text;
import java.util.Date;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ifnu
 */
@PersistenceCapable
@XmlRootElement(name = "story")
public class StoryId {

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
    
    @Persistent
    private String id;

    @Persistent
    private String header;

    @Persistent
    private String subHeader;

    @Persistent
    private String imageUrl;

    @Persistent
    private Date dateFetched = new Date();

    @Persistent
    private Text fullStory;
            
    @Persistent
    private String storyUrl;

    @Persistent
    private Boolean headline;

    public Boolean getHeadline() {
        return headline;
    }

    public void setHeadline(Boolean headline) {
        this.headline = headline;
    }

    public String getFullStory() {
        if(fullStory!=null) {
            return fullStory.getValue();
        } else {
            return null;
        }
    }

    public void setFullStory(String fullStory) {
        this.fullStory = new Text(fullStory);
    }


    public String getStoryUrl() {
        return storyUrl;
    }

    public void setStoryUrl(String storyUrl) {
        this.storyUrl = storyUrl;
    }

    public Date getDateFetched() {
        return dateFetched;
    }

    public void setDateFetched(Date dateFetched) {
        this.dateFetched = dateFetched;
    }

    public String getHeader() {
        return header;
    }

    public void setHeader(String header) {
        this.header = header;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public String getSubHeader() {
        return subHeader;
    }

    public void setSubHeader(String subHeader) {
        this.subHeader = subHeader;
    }

    public Key getKey() {
        return key;
    }

    public void setKey(Key key) {
        this.key = key;
    }

    @Override
    public String toString() {
        return storyUrl;
    }

}
